import request from '@/utils/request'
import loginRequest from '@/utils/isLoginRequest'

// 获取banner
export function getBannerApi(data) {
	return loginRequest({
		url: `/info/api/cc/banner/list`,
		method: 'GET',
		params: data
	})
}
// 获取课程方向
export function getLessonCategoryApi(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/category`,
		method: 'GET',
		params: data
	})
}

// 课程列表
export function getLessonListApi(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/lessonlist`,
		method: 'GET',
		params: data
	})
}
// 课程列表
export function getLessonDetailsApi(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/lessoninfo/${data.lessonId}`,
		method: 'GET'
	})
}
// 课程回复列表
export function getChapterCommentApi(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/lessonchaptercommentlist/${data.chapterId}`,
		method: 'GET'
	})
}
// 课程章节列表
export function getLessonChapterApi(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/lessonchapterlist/${data.lessonId}`,
		method: 'GET'
	})
}
export function getChapterHasTimeApi(data) {
	return loginRequest({
		url: `/info/api/cc/CcUserLesson/lessonchapterlist/${data.lessonId}`,
		method: 'GET'
	})
}

// 推荐课程
export function getTopLessonApi(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/goodlessonlist`,
		method: 'GET',
		params: data
	})
}
// 名师推荐
export function getGoodteacherApi(data) {
	return request({
		url: `/info/api/cc/teacher/goodteacherlist`,
		method: 'GET',
		params: data
	})
}

// 名师详情
export function getTeacherIntroApi(teacherId) {
	return request({
		url: `/info/api/cc/teacher/teacherinfo/${teacherId}`,
		method: 'GET'
	})
}

export function getMyLessonApi(data) {
	return loginRequest({
		url: `/info/api/cc/CcUserLesson/list`,
		method: 'GET',
		params: data
	})
}

// 获取单个学习进度
export function getOneLessonApi(data) {
	return loginRequest({
		url: `/info/api/cc/CcUserLesson/detailbyid`,
		method: 'GET',
		params: data
	})
}
// 获取章节进度
export function getLessnScheduleApi(data) {
	return loginRequest({
		url: `/info/api/cc/CcUserLesson/queryLessnSchedule`,
		method: 'GET',
		params: data
	})
}

// 获取章节详情
export function getChapterInfoApi(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/chapterinfo/${data.chapterId}`,
		method: 'GET'
	})
}
// 获取保存学习时间
export function upVideoDateApi(data) {
	return loginRequest({
		url: `/info/api/cc/CcUserLesson/uplodLessnSchedule`,
		method: 'GET',
		params: data
	})
}
// 继续学习
export function studyLearningApi(data) {
	return loginRequest({
		url: `/info/api/cc/CcUserLesson/getLessnSchedule`,
		method: 'GET',
		params: data
	})
}
// 获取章节下的评论列表
export function getLessinCommont(data) {
	return loginRequest({
		url: `/info/api/cc/teacher/lessoncommentlist/${data.lessonId}`,
		method: 'GET',
		params: data
	})
}
// 评论章节
export function addLessinCommont(data) {
	return loginRequest({
		url: `/info/api/web/user/addlessoncomment`,
		method: 'POST',
		data: data
	})
}